| DAO Home Page | DAO Reanalyses | DOLMS | DAO People | GrADS Home Page |

Getting Started with Win32 GrADS

Version 1.7.Beta.9

GrADS logo DAO logo

Last Update: May 1, 1998


Contents

Introduction

Win32 GrADS is a port of Brian Doty's popular Grid Analysis and Display System (GrADS) to the x86 PC running 32-bit MS Windows operating sytems (win95 and winNT).

This implementation of Win32 GrADS is functionally equivalent to all Unix versions. Supported features include:

System Requirements

Win32 GrADS is a 32-bit application. You must have the following hardware/software:

This Distribution

In this installation you will find the following sub-directories:

Sample data files are not included in this distribution; a small collection of sample gridded and station data files can be downloaded from ftp://sprite.llnl.gov/pub/fiorino/grads/data/. The GrADS binaries and executables in win32/ as well the documentation files under doc/ are further described below. We start with the necessary X Server setup.

X Server Setup

Because Win32 GrADS is based on the same code as the Unix version, it requires an X server. An X server is the software which processes instructions from "X clients" such as GrADS to do things like draw on the screen. Win32 GrADS X has worked with a wide variety of X servers including a free one which is available from Micro Images at:

http://www.microimages.com/www/html/freestuf/mix.htm

This server is somewhat limited as it does not fully support the Athena widgets (only an issue if you intend to use GradsGUI - read on). There is a fully functional demo (2 hour limit) from Starnet which is somewhat nicer:

http://www.starnet.com/docs/xwin32.html

Win32 GrADS works quite nicely with this X server. For information on setting up X-Win32 to work with GrADS click here.

For a comprehensive list of other commercially available X servers consult Kenton Lee's page:

http://www.rahul.net/kenton/xsites.html

Before proceeding, choose an X Server and install it on your machine.

Using Win32 GrADS

Now that you have installed your X Server you are ready to go. Start your X server, and from the Start menu, click on Programs, and then click on Win32 GrADS. If you are new to GrADS you may want to start with the GrADS Tutorial.

Very Important: You must start your X server before running GrADS, it is not enough to install it.

During SETUP the user can choose between a Typical (full) and a Compact installation. Depending on the Installation Option you chose, you will find the following applications in the Win32 Program Group:

Application Available w/
Compact
Installation?
Description
Grads Yes Win32 GrADS with the classic command line interface (ga-> prompt). For the Full (Typical) Installation option, this version is the same as GradsNC below and can read and write NetCDF files (but no HDF-SDS files); see sdfopen, xdfopen. For the Compact Installation option, this is the same as GradsC.
GradsC Yes Win32 GrADS with the classic command line interface (ga-> prompt), but without NetCDF/HDF-SDS, LATS, Athena GUI or Image support through the wi command. This version can read IEEE and GRIB files. This is the smallest version of Win32 GrADS and requires the least amount of memory.
GradsGUI No Win32 GrADS with a Graphical User Interface based on the Athena Widgets. This version automatically starts the gui script sample2.gui, otherwise it is the same as GradsNC below.
GradsHDF No Win32 GrADS built with NCSA's MFHDF (Multi-file HDF) library. With this configuration GrADS can read both NetCDF and HDF-SDS files (see sdfopen, xdfopen), but can only write HDF-SDS files (but cannot write NetCDF files). IEEE and GRIB files are fully supported. This version has a small glitch when reading certain 16-bit packed NetCDF files; see Bugs below.
GradsNC No Win32 GrADS built with Unidata's NetCDF library. With this configuration GrADS can read (see sdfopen, xdfopen) and write NetCDF files, but cannot handle HDF-SDS files. IEEE and GRIB files are fully supported.
Gv Yes Windows' based GrADS metafile viewer.
Gxtran Yes Classic metafile viewer (Gv is nicer).
Gxgif Yes Converts GrADS metafiles to GIF. See the new wi (write image) command for an alternative way of creating GIF images directly from GrADS.
Gxeps Yes Converts GrADS metafiles to enscapsulated postscript (faster). You may want to obtain the Windows version of Ghostview (gsview), freely available from http://www.cs.wisc.edu/~ghost/gsview/. Gsview will allow you to preview and print PostScript documents on win95/NT. Highly recommended.
Gxps Yes Converts GrADS metafiles to postscript level 1 (slower)
Gribmap Yes GRIB file mapping utility
Gribscan Yes GRIB file scan utility
Grib2ctl.pl Yes Creates a GrADS control (.ctl) file for a GRIB file. This application requires Perl to be installed on your system. You can obtain a free copy of Perl for Win32 at this address: http://www.activestate.com/software/default.html.
Wgrib Yes Wes Ebisuzaki's GRIB utility (it slices, dices)
Stnmap Yes Station mapping utility
Ncdump No Convert NetCDF/NDF-SDS files to ASCII form (CDL). For source code and additional information consult http://www.unidata.ucar.edu/packages/netcdf.
Ncgen No From a CDL file generate a netCDF file, a C program, or a Fortran program. For source code and additional information consult http://www.unidata.ucar.edu/packages/netcdf.
HDFdump No Similar to Ncdump, but can read HDF-SDS files. Note: avoid using this utility for NetCDF files due to a bug related to packed NetCDF files. For source code and additional information consult http://hdf.ncsa.uiuc.edu.
Hdfgen No Similar to Ncgen, but output is in HDF-SDS format.For source code and additional information consult http://hdf.ncsa.uiuc.edu.
CDCncdmp No CDC version of Ncdump. It produces output in a more human readable format. However, the output of this utility is not compatible with Ncgen.
sh Yes Win32 port of the  GNU Bourne Again Shell (bash). This utility is needed for executing shell commands from grads, e.g., ! ls. For documentation of GNU software consult http://www.gnu.org/doc/doc.html. For  source code and additional information, consult http://www.cygnus.com/gnu-win32. 
 ls, cp, rm. mv, pwd, cat Yes Assorted GNU file utilities to facilitate porting GrADS scripts from Unix to Win32.  For documentation of GNU software consult http://www.gnu.org/doc/doc.html For source code and additional information, consult http://www.cygnus.com/gnu-win32. 
convert, display, animate, import, montage, mogrify, identify, combine No Image Magick tools. For source code and additional information consult http://www.wizards.dupont.com/cristy/. A local copy of this page is available here.
*.dll Some These are Dynamic Link Libraries (DLL) needed by the applications above. If you move them to a different directory, make sure they remain in your PATH. The DLL files above are usually not visible from the Win32 GrADS Program Group. You can change this default behavior from the View/Properties menu of the Windows Explorer.

You can also start Win32 GrADS or any of the applications above from the DOS command line, e.g.,

c:\> grads

Recall that DOS is case insensitive, so grads is the same as GrADS.

Documentation

The sub-directory doc/ contains several documentation files of interest. Please notice that some of the documentation is out of date (the manual is for version 1.5 and the Unix manual pages for version 1.6). They have been included here under the assumption that out of date documentation is better than no documentation at all. These files will be updated as revised versions become available.

Document

Description

Tutorial/ GrADS Tutorial by Brian Doty, including screenshots. If you are new to GrADS this is a good place to start. Users will need to download a sample data file in order to run this tutorial.
Manual.doc GrADS 1.5 documentation in MS Word format. This file can be viewed and printed with WordPad, the wordprocessor bundled with Windows 95/NT. For a description of the changes between GrADS v1.5 documented in this manual and the current GrADS v1.7 consult fiorino/grads.1.7.beta.7.new.htm and fiorino/grads.1.7.new.htm
Manual/ GrADS Version 1.5.1 Reference Manual in HTML. For a description of the changes between GrADS v1.5 documented in this manual and the current GrADS v1.7 consult fiorino/grads.1.7.beta.7.new.htm and fiorino/grads.1.7.new.htm
cards/ Quick reference cards for GrADS commands and GrADS scripting language in PostScript, both in A4 and US Letter sizes:
  • refv1.7-a4.ps -GrADS reference card (DIN A4)
  • refv1.7-scl-a4.ps - GrADS scripting language reference card (DIN A4)
  • refv1.7-letter.ps -GrADS reference card (US Letter)
  • refv1.7-scl-letter.ps -GrADS scripting language reference card (US Letter)

Thse cards are contributed by Karin Meier-Fleischer (meier-fleischer@dkrz.de). The official site for these cards is ftp://ftp.dkrz.de:/pub/visu/grads/doc.

You may want to obtain the Windows version of Ghostview (gsview), freely available from http://www.cs.wisc.edu/~ghost/gsview/. Gsview allows you to preview and print PostScript documents on win95/NT. Highly recommended.

hoop/ Documentation for Don Hooper's sdfopen and xdfopen commands. Consult these documents for reading NetCDF/HDF-SDS files with GrADS.
gagui/ Using GrADS with Athena Widgets, HTML document
magick/ ImageMagick documentation.
doty/ Assorted text documents by Brian Doty:
  • corr.txt - notes on correlation functions
  • crsect.txt - notes on arbitrary cross-sections
  • drop.txt - notes on the drop menu feature of gs widgets
  • font.txt - describes the format of font files
  • map.txt - describes the format of map background files
  • mpt.txt - describes the mpt command used to control map background behavior
  • pdef.txt - notes on the usage of PDEF in GrADS 1.7
fiorino/ Assorted HTML documents by Mike Fiorino:
etc/ Unix style manual pages/text documents for several utilities:
  • grads.html - GrADS Unix manual page for version 1.6.beta.4. Please notice that there is no need for setting the environment variables GADDIR, GASCRP, etc in this WIn32 version.
  • grib.txt - Text file with information about working with GRIB files
  • grib2ctl.html - Local copy of grib2ctl home page.
  • grib2ctl.txt - Text documentation for grib2ctl
  • gribmap.html - Unix manual page
  • gribscan.html - Unix manual page
  • gxeps.html - Unix manual page
  • gxps.html - Unix manual page
  • gxtran.html - Unix manual page
  • proj.txt - Text file with information about working with map projections
  • ncdump.html - Unix manual page
  • ncgen.html - Unix manual page
  • outxwd.txt - Describes the outxwd command which produces an X window dump of the GrADS graphics screen
  • stnmap.html - Unix manual page
  • wgrib.html - Local copy of wgrib's home page
  • wgrib.txt - Text documentation for wgrib

Using GrADS with Athena Widgets

Starting with version 1.7, GrADS provides a simpler way for creating widgets (graphical user interface) from a user defined GUI script. A GUI script included in this distribution alllows you to build the following user Graphical User Interface for GrADS:

For additonal information consult the document Using GrADS with Athena Widgets.

Notes:

  1. If you are familiar with X11 widgets build with "gs" scripts, note that this is a completely different set of functions for building event driven widgets. Currently, there is a separate script processor (the gui command available from the ga-> prompt) for handling these functions. The Win32 application GradsGUI automatically starts a GUi script for you; try it!
  2. This is an experimental version: both the scripting language as well as the available callbacks may change in the near future.
  3. Although it does not crash the free X server from Micro Images, the menu items become invisible when you try to select it (this is due to a bug in the MI/X server). This feature works much better with the X-Win32 server from StarNet.
  4. You can also add a graphical user interface (GUI) to GrADS by using the XGrads package based on tcl/tk. This package has been shown to run on Win32. For more information, take a look at:
  5. ftp://sprite.llnl.gov/pub/fiorino/grads/XGrads/xgrads.win32.tar

Writing GIF and other image formats from GrADS

Starting with version 1.7.beta.7, the command wi (write image) saves the contents of the GrADS graphics screen directly to an image file. There is no need for writing a GrADS metafile or doing conversions to GIF or to other format, the output is already in the desired format. This feature is implemented in Win32 GrADS by means of an interface to the ImageMagick library, and it does not work in batch mode (-b option). Notice that this is an experimental command: both syntax and functionality may change in future releases.

To try it out, display something on the graphics screen, say, run rgbmap, and at the ga-> prompt enter

wi test.gif for writing a GIF file
wi test.jpeg for writing a JPEG file
wi test.bmp for writing a Windows BMP file
etc.

The general syntax for the wi command is:

wi fname.fmt

where fname is a generic file name, and fmt is one of the ImageMagick supported formats: gif, bmp, cgm, eps, fax, ico, jpeg, pcx, hdf, and many more.

Notes

  1. The related command outxwd produces an xwd (X window dump) image file, being equivalent to wi fname.xwd. Noticed that outxwd currently now works with Win32 GrADS.
  2. If a file name extension is not specified, GIF is the default.
  3. Some ImageMagick formats (tiff, png, mpeg, ...) are not yet supported by Win32 GrADS.
  4. Make sure no other window is on top of your GrADS graphics windows when issuing a wi command, as wi takes a snapshot of the current state of this window. For example, if a text editor window is partially covering your graphics window, your image file will contain the combination of these 2 windows.
  5. If a format is not recognized (or supported), the image will be saved in MIFF, ImageMagick's native format.
  6. See Bugs for problems on systems with more than 256 colors.

Bugs

On some systems the following problems have been reported:

  1. On Windows 95 systems, GradsHDF, the version built with the NCSA MFHDF library has a subtle bug when reading certain 16-bit (short) packed NetCDF files (examples are NCEP re-analysis files converted to NetCDF at CIRES/CDC). Although GrADS is able to produce a plot, it mistankenly produces very large values for a hand full of grid points. Work around: use GradsNC in such cases. This problem has not been reported on Windows NT systems.
  2. X Windows widgets built with gs scripts may miss/delay some X events (keyboard/mouse clicks). This problem appears to occur only on Windows 95; it has not been reported on Windows NT.
  3. Athena widgets built with gui scripts: menu items become invisible when selected (MI/X Server only); some mouse delays on Windows 95.
  4. The wi command has been reported to produce black and white GIF output on VGA systems with more than 256 colors. The workaround is to write a JPEG image, or to change your Windows display to 256 colors.

Acknowledgements

This Win32 port was contributed by Arlindo da Silva from the Data Assimilation Office (NASA/GSFC), in collaboration with Mike Fiorino from PCMDI/Lawrence Livermore National Laboratory. Win32 GrADS is built with the Cygnus GNU Win32 compiler. Sergey Okhapkin ported X11R6.3 to GNU Win32. The wi command is implemented through an interface to ImageMagick API; ImageMagick is written by John Cristy. Don Hooper helped porting the SDF interface; Steve Emmerson provided guidance with UDUNITS. Brian Doty tested some of the grads widget features. Many thanks to all.


Please direct all Win32 GrADS questions to:

GrADS User Group List Server

This server is used for the exchange of information on GrADS, announcements of upgrades, scripts, user defined functions, problem solving, etc. To subscribe, send mail to Sanzio Bassini (bassini@cineca.it) requesting inclusion in the GrADS User Group mailing list. Make sure to include your full name, affiliation and e-mail address.


An online archive for the listserver is maintained at:


| DAO Home Page | DAO Reanalyses | DOLMS | DAO People | GrADS Home Page |


Data Assimilation Office / Code 910.3 / NASA - Goddard Space Flight Center

Office Head: Ricky Rood
Page Author: Arlindo da Silva